﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Net.Fan.SmallPig.BusinessRules;
using Net.Fan.SmallPig.Common;
using System.Data;
using Net.Fan.SmallPig.DataAccess;

public partial class Job_SearchJob : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void ButtonSearch_Click(object sender, EventArgs e)
    {
        JobTimeStatus jts = JobTimeStatus.Running;
        string type = RadioButtonList1.SelectedValue.ToUpper();
        switch (type)
        {
            case "ALL":
                {
                    jts = JobTimeStatus.All;
                    break;
                }
            case "RUNNING":
                {
                    jts = JobTimeStatus.Running;
                    break;
                }
            case "FINISHED":
                {
                    jts = JobTimeStatus.Finished;
                    break;
                }
            default:
                {
                    break;
                }
        }

        DataTable jobs = JobBiz.SearchJobs(TextBoxKey.Text.Trim(), jts);
        JobGridView1.Jobs = jobs;
    }
    protected void ButtonOpen_Click(object sender, EventArgs e)
    {
    }
}
